<template>
  <div class="custom-body" :style="borderStyle">
    <div class="body-custom" :style="bodyStyle">
      <div
        v-if="showHeader && temp.sfxsbt"
        class="custom-header"
      >
        <div class="header-body">
          <div v-if="temp.sfsxtb === true" class="header-icon">
            <i :class="temp.tb" />
          </div>
          <div class="header-title">
            <span class="title-span">{{ temp.name }}</span>
          </div>
          <div
            v-if="temp.isMore === true"
            class="header-icon more"
            @click="callBack"
          >
            更多
          </div>
        </div>
      </div>
      <el-empty
        v-if="dataList === null || dataList.length === 0"
        class="custom-right"
        :image-size="100"
      />
      <div v-else class="custom-right">
        <div
          v-for="(item, index) in dataList"
          :key="'server-' + index"
          :style="liStyle"
          class="custom-right-li"
          @click="openEntity(item)"
        >
          <div class="custom-li-body">
            <div class="custom-li-image">
              <el-image
                lazy
                class="custom-image"
                :src="baseURL + item[column['image']]"
              />
            </div>
            <div class="custom-li-title">{{ item[column["title"]] }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mobile } from '@/mixins/mobile'
export default {
  name: 'AppImageListTempV1',
  mixins: [mobile({ tabs: 'temp' })]
}
</script>

<style scoped>
.custom-body {
  width: 100%;
  height: 100%;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}
.body-custom {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-flow: column nowrap;
}
.custom-header {
  width: 100%;
  height: 50px;
  flex: 0 1 auto;
  padding: 0 10px;
  box-sizing: border-box;
  line-height: 50px;
  cursor: pointer;
}
.header-body {
  width: 100%;
  height: 51px;
  display: flex;
  flex-flow: row nowrap;
}

.header-icon {
  width: 20px;
  height: 50px;
  flex: 0 1 auto;
  text-align: center;
  color: #409eff;
  font-size: 1.1rem;
}

.header-icon.more {
  width: 50px;
  font-size: 0.9rem;
}

.header-title {
  height: 50px;
  flex: 1 1 auto;
  font-size: 0.9rem;
}
.title-span {
  height: 40px;
  padding: 12px 5px;
  box-sizing: border-box;
  line-height: 40px;
  text-align: center;
  position: relative;
  font-weight: bolder;
}
.custom-right {
  flex: 1 1;
  width: 100%;
}
.custom-right-li {
  width: 33.3333%;
  padding: 5px 10px;
  box-sizing: border-box;
  cursor: pointer;
  height: 50%;
  float: left;
  position: relative;
}
.custom-li-image {
  width: 100%;
  height: 40px;
  text-align: center;
}
.custom-li-title {
  width: 100%;
  text-align: center;
  font-size: 13px;
  line-height: 15px;
  height: 30px;
  overflow: hidden;
}
.custom-li-body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.custom-image {
  width: 30px;
}
</style>
